//
//  Student.swift
//  DemoUI
//
//  Created by 白瑾浩 on 2022/1/12.
//

import Foundation
import UIKit

class Student: NSObject {

    var name:String?
    var age:Int = 0
    
     init(name:String,age:Int) {
        self.name = name
        self.age = age
    }
    
    func insert() {
        let inserSql = "INSERT INTO t_student (name,age) VALUES ('\(String(describing: name!))',\(age));"
        if SQManger.shareInstence().execSql(sql: inserSql){
            print("插入数据成成功")
        }else{ print("插入数据失败")}
    }
   class func loadData() -> [Any]? {
//        return SQManger.shareInstence().querySql(sql: "SELECT name,age FROM t_student")
    
      return SQManger.shareInstence().querySql(sql: "SELECT name,age FROM t_student")
    }
    
}
